package com.example.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class mvcConfig implements WebMvcConfigurer {
//      不需要为每一个访问thymeleaf模板页面单独开发一个controller
      @Override
      public void addViewControllers(ViewControllerRegistry registry) {
//            WebMvcConfigurer.super.addViewControllers(registry);

//            viewController  请求路径  viewName  跳转视图
            registry.addViewController("index").setViewName("index");
            registry.addViewController("adminIndex").setViewName("adminIndex");
            registry.addViewController("adminUserLists").setViewName("adminUserLists");
//            registry.addViewController("userIndex").setViewName("userIndex");
//            registry.addViewController("merchantAddMenu").setViewName("merchantAddMenu");
      }
}
